from detect import Detect
from PIL import Image
import numpy as np


conf ={
    "conf_thres": 0.55,
    "input":{
      "height": 512,
      "width": 512,
    },
    "iou_thres": 0.65,
    "model": "/data/detect/model/qntyolov8_512.rknn",
    "name":"233"
}

rknn = Detect(conf=conf)
img_f="timgs/"
for i in range(2009,2024):
    img = Image.open(img_f+f"{i}.jpg").convert("RGB")
    img = np.array(img)
    # 转换为 numpy 数组 (H, W, 3)，每个像素是 [R, G, B]
    rgb_array = np.array(img)
    rknn.load_frame_info(img)
    boxes,classes,scores = rknn.predict(img)
    print(classes)